







<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so search-form">
            <input class="layui-input"  autocomplete="off" placeholder="开始日" name="date1"  value="{:input('date1')}" id="start">
            <input class="layui-input"  autocomplete="off" placeholder="截止日" name="date2"  value="{:input('date2')}" id="end">
            <input type="text" name="search_data"  placeholder="用户名|UID" autocomplete="off" value="{:input('search_data')}"  class="layui-input">

            <div class="layui-input-inline">
                <select name="state">
                    <option value="" >全部状态</option>
                    <option value="0" {if condition=" isset( $param['state']) && $param['state'] eq '0'"} selected="selected" {/if} >待审核</option>
                    <option value="1" {notempty name="param['state']"}{if condition="$param['state'] eq 1"} selected="selected" {/if}{/notempty} >提现成功</option>
                    <option value="2" {notempty name="param['state']"}{if condition="$param['state'] eq 2"} selected="selected" {/if}{/notempty} >失败</option>
                    <option value="4" {notempty name="param['state']"}{if condition="$param['state'] eq 4"} selected="selected" {/if}{/notempty} >等待匹配</option>
                    <option value="5" {notempty name="param['state']"}{if condition="$param['state'] eq 5"} selected="selected" {/if}{/notempty} >商家已接单</option>
                    <option value="6" {notempty name="param['state']"}{if condition="$param['state'] eq 6"} selected="selected" {/if}{/notempty} >商家已打款</option>
                    <option value="7" {notempty name="param['state']"}{if condition="$param['state'] eq 7"} selected="selected" {/if}{/notempty} >商家打款超时</option>
                    <option value="8" {notempty name="param['state']"}{if condition="$param['state'] eq 8"} selected="selected" {/if}{/notempty} >放行超时</option>
                    <option value="9" {notempty name="param['state']"}{if condition="$param['state'] eq 9"} selected="selected" {/if}{/notempty} >申诉中</option>
                </select>
            </div>
            <button class="layui-btn"  id="search"  url="{:url('cash_withdrawal_list')}"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>
    <xblock>
        <ob_link><a  href="{:url('add_withdrwal')}" style="color: white">   <button class="layui-btn" > 批量生成提现订单</button></a></ob_link>
        <ob_link><a  href="{:url('cash_withdrawal_list',['date_type'=>1])}" style="color: white">   <button class="layui-btn layui-btn-danger" >今 天</button></a></ob_link>
        <ob_link><a  href="{:url('cash_withdrawal_list',['date_type'=>2])}" style="color: white">   <button class="layui-btn layui-btn-danger" >昨 天</button></a></ob_link>
        <ob_link><a  href="{:url('cash_withdrawal_list',['date_type'=>3])}" style="color: white">   <button class="layui-btn layui-btn-danger" >近7天</button></a></ob_link>
        <ob_link><a  href="{:url('cash_withdrawal_list',['date_type'=>4])}" style="color: white">   <button class="layui-btn layui-btn-danger" >近30天</button></a></ob_link>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <!--<button class="layui-btn" onclick="x_admin_show('添加用户','./member-add.html',600,400)"><i class="layui-icon"></i>添加</button>-->

        <ob_link> <button class="layui-btn export" url="{:url('exportCashWithdrawalList')}"> 导 出</button></ob_link>
        <span class="x-right" style="line-height:40px;margin-right:10px;">共有数据：{$list.count} 条</span>
    </xblock>

    <hr/>
    <div class="layui-table x-admin">

        <span>
                提现次数：{$list.arr.account1}
        </span>
        |
        <span style="margin-left: 30px;">
                提现总金额：￥{$list.arr.account2}
        </span>
        |
        <span style="margin-left: 30px;">
                商家代发金额：{$list.arr.account3}个
        </span>
        |
        <span style="margin-left: 30px;">
                系统提现金额：{$list.arr.account4}个
        </span>



    </div>
    <hr/>
    <table class="layui-table x-admin">
        <thead>
        <tr>
            <th>
                序号
            </th>
            <th>用户信息</th>

            <th>提现信息</th>
            <th>信息</th>
            <th>提现订单信息</th>

            <th>操作</th>
        </thead>
        {notempty name='list.list'}
        <tbody>
        {volist name='list.list' id='vo' key="k"}
        <tr>
            <td class="">
                {$k}
            </td>
            <td class="">
                <div> <label>会员账号:</label><span>{$vo.username}</span></div>
                <div> <label>手机号:</label><span>{$vo.mobile}</span></div>
                <div> <label>是否公司账户:</label><span>{if condition="$vo.is_company eq 1"}是{else/}否{/if}</span></div>
                <div> <label>是否赌王:</label><span>{if condition="$vo.is_king eq 1"}是{else/}否{/if}</span></div>
                <div> <label>是否商家:</label><span>{if condition="$vo.is_shop eq 1"}是{else/}否{/if}</span></div>
            </td>
            <td class="">
                <div> <label>剩余金额:</label><span>{$vo.money}</span></div>
                <div> <label>提现金额:</label><span>{$vo.number}</span></div>
                <div> <label>手续费:</label><span>{$vo.poundage_number}</span></div>
                <div> <label>提现方式:</label><span>{$vo.pay_text}</span></div>
            </td>
            <td class="">
               {if condition="$vo.is_alipay eq 1"} <div> <label>支付宝:</label><a href="javascript:payinfo({$vo.id},1);" style="color: #0a8cd2"> <span class="payinfo" >查看收款信息</span></a></div>{/if}
                {if condition="$vo.is_weixin eq 1"} <div> <label>微信:</label><a href="javascript:payinfo({$vo.id},2);" style="color: #0a8cd2"> <span class="payinfo" >查看收款信息</span></a></div>{/if}
                {if condition="$vo.is_bank eq 1"} <div> <label>银行卡:</label><a href="javascript:payinfo({$vo.id},3);" style="color: #0a8cd2"> <span class="payinfo" >查看收款信息</span></a></div>{/if}
            </td>

            <td class="">
                <div> <label>状态:</label><span>{$vo.state_text}</span></div>
                <div> <label>提交时间:</label><span>{$vo.create_time}</span></div>
                {if condition="$vo.otc_order eq true && $vo.state gt 4 "}
                    <div> <label>商家接单时间:</label><span>{$vo.otc_order.create_time}</span></div>
                    {if condition="$vo.otc_order.pay_time eq true && $vo.state gt 4 "}
                    <div> <label>商家完成打款时间:</label><span>{$vo.otc_order.pay_time}</span></div>
                    {/if}
                    {if condition="$vo.otc_order.pay_expire_time && $vo.state gt 4 "}
                    <div> <label>打款超时时间:</label><span>{$vo.otc_order.pay_expire_time}</span></div>
                    {/if}
                    {if condition="$vo.otc_order.receive_time && $vo.state gt 5 "}
                    <div> <label>提现人确认收款时间:</label><span>{$vo.otc_order.receive_time}</span></div>
                    {/if}
                    {if condition="$vo.otc_order.receive_expire_time && $vo.state gt 5" }
                    <div> <label>收款超时时间:</label><span>{$vo.otc_order.receive_expire_time}</span></div>

                    {/if}
                {/if}

            </td>


            <td class="td-manage ">



                {if condition="$vo['state'] eq 0   "}
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="批准" style="color: #0a8cd2"   href="javascript:reply({$vo.id},1);" >
                    批准
                </a></span></div>
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="拒绝" style="color: #0a8cd2"  href="javascript:reply({$vo.id},2);" >
                    拒绝
                </a></span></div>
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="通过审核" style="color: #0a8cd2"  href="javascript:reply({$vo.id},4);" >
                    通过审核
                </a></span></div>
                {/if}
                {if condition="$vo['state'] eq 4  || $vo['state'] eq 7   "}
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="立即匹配" style="color: #0a8cd2"  href="javascript:match({$vo.id});">
                    立即匹配
                </a></span></div>
                {/if}

                {if condition="$vo['state'] eq 5   "}
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="商家打款" style="color: #0a8cd2"   href="javascript:reply({$vo.otcorder.id},6);" >
                    商家打款
                </a></span></div>
                {/if}

                {if condition="$vo['state'] eq 6   "}
                <div style="margin-bottom: 5px;"><label></label><span>   <ob_link><a class="ajax-get " style="color: #0a8cd2" href="{:url('otc/trade_order_detail', array('id' => $vo.otcorder['id'], 'state' =>2,'update'=>2))}">  订单已放行</a></ob_link></span></div>
                {/if}


            </td>
        </tr>
        {/volist}
        {else/}
        <tbody><tr class="odd"><td colspan="12" class="" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
        {/notempty}

        </tbody>
    </table>
    <div class="page">
        {notempty name='list.list'}   {$list.list->render()}{/notempty}
    </div>

</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        layer=layui.layer;
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });



    function reply(id ,state) {
        if(state==6){
            layer.open({
                type: 2 //此处以iframe举例
                ,title: '商家付款'
                ,area: ['50%', '70%']
                ,shade: 0
                ,maxmin: true
                ,content: "cash_withdrawal_list?id="+id+'&state='+state+'&otcorder=1'
                ,btn: [] //只是为了演示
            });

        }else{
            layer.open({
                type: 2 //此处以iframe举例
                ,title: '审核提现'
                ,area: ['50%', '70%']
                ,shade: 0
                ,maxmin: true
                ,content: "trade_check/id/"+id+'/state/'+state
                ,btn: [] //只是为了演示
            });
        }

    }


    function match(id) {

        layer.open({
            type: 2 //此处以iframe举例
            ,title: '匹配商家'
            ,area: ['50%', '70%']
            ,shade: 0
            ,maxmin: true
            ,content: "trade_check/id/"+id+'/is_match/1'
            ,btn: [] //只是为了演示
        });


    }

    function payinfo(id ,state) {
        layer.open({
            type: 2 //此处以iframe举例
            ,title: '收款信息'
            ,area: ['50%', '70%']
            ,shade: 0
            ,maxmin: true
            ,content: "cash_withdrawal_list?id="+id+'&type='+state+'&payinfo=1'
            ,btn: [] //只是为了演示
        });
    }



    //导出功能
    $(".export").click(function(){

        window.location.href = searchFormUrl($(".export"));
    });
</script>

</body>

</html>




